package com.gome.axwl.aoc.common.constants;

import java.util.ArrayList;
import java.util.List;

public class LoginConstant {

    /**
     * 存储在缓存中的用户信息的key
     */
    public static final String LOGIN_USER = "login_user";

    /**
     * 登录接口的URI
     */
    public static final String LOGIN_URI = "/user/login";

    /**
     * 登出接口的URI
     */
    public static final String LOGOUT_URI = "/api/logout";

    /**
     * swagger的URI
     */
    public static final String SWAGGER_URI = "/swagger-ui.html";

    /**
     * swagger的js的URI
     */
    public static final String SWAGGER_JS_URI = "/webjars.*";

    /**
     * swagger的resources的URI
     */
    public static final String SWAGGER_RESOURCES_URI = "/swagger-resources.*";

    /**
     * swagger的docs的URI
     */
    public static final String SWAGGER_DOCS_URI = "/v2/api-docs";

    /**
     * API已授权信息获取的URI
     */
    public static final String API_AUTHORIZED_URI = "/api/limit/authorized";

    /**
     * 第三方应用，获取权限菜单URI
     */
    public static final String APP_MENU_URI = "/AuthUser/queryMenus";

    /**
     * 第三方应用，根据AppKey获取APP信息URI
     */
    public static final String APP_INFO_BY_APPKEY_URI = "/app/showAppInfoBykey";

    /**
     * 前端，拉取菜单信息URI
     */
    public static final String FRONT_GET_MENU_URI = "/user/info";

    /**
     * spring boot admin检查健康状态的URI
     */
    public static final String SPRING_BOOT_ADMIN_HEALTH = "/health";
    public static final String SPRING_BOOT_ADMIN_CONFIGPROPS = "/configprops";
    public static final String SPRING_BOOT_ADMIN_LOGFILE = "/logfile";
    public static final String SPRING_BOOT_ADMIN_INFO = "/info";
    public static final String SPRING_BOOT_ADMIN_METRICS = "/metrics";
    public static final String SPRING_BOOT_ADMIN_ICO_FAVICON = "/favicon.ico";
    public static final String SPRING_BOOT_ADMIN_LOGGERS = "/loggers";
    public static final String SPRING_BOOT_ADMIN_ENV = "/env";
    public static final String SPRING_BOOT_ADMIN_AUDITEVENTS = "/auditevents";
    public static final String SPRING_BOOT_ADMIN_LIQUIBASE = "/liquibase";
    public static final String SPRING_BOOT_ADMIN_HEAPDUMP = "/heapdump";
    public static final String SPRING_BOOT_ADMIN_JOLOKIA = "/jolokia";
    public static final String SPRING_BOOT_ADMIN_FLYWAY = "/flyway";
    public static final String SPRING_BOOT_ADMIN_DUMP = "/dump";
    public static final String SPRING_BOOT_ADMIN_TRACE = "/trace";


    /**
     * spring cloud hystrix uri
     */
    public static final String SPRING_CLOUD_HYSTRIX_STREAM = "/hystrix.stream";

    /**
     * sso过滤器白名单URI
     */
    public static final List<String> SPRING_SSO_EXCLUDE_URI = new ArrayList<>();
    static {
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_HEALTH);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_CONFIGPROPS);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_LOGFILE);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_INFO);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_METRICS);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_ICO_FAVICON);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_LOGGERS);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_ENV);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_AUDITEVENTS);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_LIQUIBASE);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_HEAPDUMP);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_JOLOKIA);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_FLYWAY);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_DUMP);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_BOOT_ADMIN_TRACE);
        SPRING_SSO_EXCLUDE_URI.add(SPRING_CLOUD_HYSTRIX_STREAM);
        SPRING_SSO_EXCLUDE_URI.add(SWAGGER_URI);
        SPRING_SSO_EXCLUDE_URI.add(SWAGGER_JS_URI);
        SPRING_SSO_EXCLUDE_URI.add(SWAGGER_RESOURCES_URI);
        SPRING_SSO_EXCLUDE_URI.add(SWAGGER_DOCS_URI);
        SPRING_SSO_EXCLUDE_URI.add(API_AUTHORIZED_URI);
        SPRING_SSO_EXCLUDE_URI.add(APP_INFO_BY_APPKEY_URI);
        SPRING_SSO_EXCLUDE_URI.add(APP_MENU_URI);
    }

    /**
     * 本机过滤器白名单URI
     */
    public static final List<String> SPRING_EXCLUDE_URI = new ArrayList<>();
    static {
        SPRING_EXCLUDE_URI.addAll(SPRING_SSO_EXCLUDE_URI);
        SPRING_EXCLUDE_URI.add(LOGIN_URI);
        SPRING_EXCLUDE_URI.add(LOGOUT_URI);
    }

}
